Skip to content

refactor(core): separate generic runtime primitives from domain specifics and fix live playthrough P0/P1 defects - #39

Merged
mcocdaa merged 1 commit into
mainfrom
refactor/generic-separation-live-fixes
Nov 21, 2026
Merged

mcocdaa merged 1 commit into
mainfrom
refactor/generic-separation-live-fixes

Conversation

@mcocdaa

@mcocdaa mcocdaa commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Separates generic runtime primitives (IHttpRequestDecorator, ToolScopeProjection, LlmPayloadParser, OpenAIWireCodec, PromptZonePartitioner, HttpErrorClassifier, EndpointFailoverPolicy, RimMindHttpClientPool, CompositeToolCallBase, RimMindChatWindowBase, SettingsUIDrawer, IBioTabBadgeProvider) from vendor/submodule specifics; splits AgentDecision/AdvisorDecision scenarios with ScenarioIds.IsDecisionScenario; enforces main-thread dispatch, KV-cache L1/L2 purity, honest cached token telemetry, queue coalescing/TTL/lifecycle cancellation, and idle overlay hiding. Verified with 209/209 Core tests, ArchTests, and 4-day live playthrough (0 Verse errors, 75.39% real KV-cache hit rate).

…fics and fix live playthrough P0/P1 defects

refactor: extract generic building blocks and enforce vendor separation

Extract reusable, engine-free building blocks into Application so Core and
submodules share one implementation, and remove vendor-specific literals
from generic infrastructure.

- Add OpenAIWireCodec, LlmPayloadParser, HttpErrorClassifier,
  EndpointFailoverPolicy, LogSecretRedactor, PromptZonePartitioner,
  RimMindHttpClientPool, MoteTextFormatter, ToolScopeProjection,
  AutonomyDomainRiskMapper, and UnboundedCompletionFence; forward the old
  LogSanitizer/OpenAIRequestSerializer facades to the new types.
- Replace HttpTransport's OpenCode header sniffing with an
  IHttpRequestDecorator seam plus a concrete OpenCodeHeaderDecorator.
- Make MechanismToolHandler resolve autonomy domains via
  IMechanismAutonomyMetadata instead of hardcoding pawn.work, and reject
  write operations off the Unity main thread.
- Add ToolScope flags and scope-filtered, compacted tool definitions;
  introduce AgentDecision/AdvisorDecision scenarios with shared decision
  weights and ScenarioIds.IsDecisionScenario.
- Add request queue coalescing, MaxQueueWaitTicks/ExpiresAtUtc TTLs,
  pre-dispatch colonist liveness gating, and CancelByNpcId.
- Split MapContextBuilder into static topology vs volatile colony
  resources, add MapResourceCounter, and clear caches on game lifecycle.
- Add AIProviderRegistry presets, BioTabBadgeRegistry with a single
  DoTopStack transpiler, RimMindChatWindowBase, SettingsUIDrawer secret
  fields, and generic API helpers (ActorMapResolver,
  CompositeToolCallBase, WorldScopedComponentCache).
- Default settings and backup endpoints now use OpenAI instead of
  DeepSeek/OpenCode; drop the OpenCode backup button and its strings.
- Add architecture and phase-2 contract tests locking in these
  boundaries.
@mcocdaa
mcocdaa merged commit 530a072 into main Nov 21, 2026
1 check passed
@mcocdaa
mcocdaa deleted the refactor/generic-separation-live-fixes branch November 21, 2026 10:40
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant